		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        2/7/2009
 * PROJECT:             MCWEBSITE
 * PURPOSE:             websiteCustomerEmailBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;

namespace MCWEBSITE.BUL
{
    public class websiteCustomerEmailBUL
    {
        public static int Save(websiteCustomerEmailInfo _websiteCustomerEmailInfo)
        {
            try
            {
                if (_websiteCustomerEmailInfo.CustomerEmailId == 0)
                {
                    return websiteCustomerEmailDAL.Insert(_websiteCustomerEmailInfo);
                }
                else
                {
                    return websiteCustomerEmailDAL.Update(_websiteCustomerEmailInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }

        public static int Remove(int _CustomerEmailId)
        {
            try
            {
                return websiteCustomerEmailDAL.Delete(_CustomerEmailId);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static List<websiteCustomerEmailInfo> GetAll()
        {
            try
            {
                return websiteCustomerEmailDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteCustomerEmailInfo Load(int _CustomerEmailId)
        {
            try
            {
                return websiteCustomerEmailDAL.SelectOne(_CustomerEmailId);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<websiteCustomerEmailInfo> Search()
        {
            try
            {
                return websiteCustomerEmailDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static DataSet GetCustomerEmailWithFilter(string CusId,string CusName,string CusEmail)
        {
            try
            {
                return websiteCustomerEmailDAL.CustomerEmailFilter(CusId, CusName, CusEmail);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }
    }
}

		